package com.ylr.grpc;

import io.grpc.stub.ClientCalls;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 * <pre>
 * ---------------------- callback ----------------------
 * </pre>
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.32.1)",
    comments = "Source: ExecutorBiz.proto")
public final class AdminBizGrpc {

  private AdminBizGrpc() {}

  public static final String SERVICE_NAME = "AdminBiz";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<ExecutorBizProto.CallbackParamListRequest,
      ExecutorBizProto.ResultReply> getCallbackMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "callback",
      requestType = ExecutorBizProto.CallbackParamListRequest.class,
      responseType = ExecutorBizProto.ResultReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<ExecutorBizProto.CallbackParamListRequest,
      ExecutorBizProto.ResultReply> getCallbackMethod() {
    io.grpc.MethodDescriptor<ExecutorBizProto.CallbackParamListRequest, ExecutorBizProto.ResultReply> getCallbackMethod;
    if ((getCallbackMethod = AdminBizGrpc.getCallbackMethod) == null) {
      synchronized (AdminBizGrpc.class) {
        if ((getCallbackMethod = AdminBizGrpc.getCallbackMethod) == null) {
          AdminBizGrpc.getCallbackMethod = getCallbackMethod =
              io.grpc.MethodDescriptor.<ExecutorBizProto.CallbackParamListRequest, ExecutorBizProto.ResultReply>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "callback"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ExecutorBizProto.CallbackParamListRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ExecutorBizProto.ResultReply.getDefaultInstance()))
              .setSchemaDescriptor(new AdminBizMethodDescriptorSupplier("callback"))
              .build();
        }
      }
    }
    return getCallbackMethod;
  }

  private static volatile io.grpc.MethodDescriptor<ExecutorBizProto.RegistryParamRequest,
      ExecutorBizProto.ResultReply> getRegistryMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "registry",
      requestType = ExecutorBizProto.RegistryParamRequest.class,
      responseType = ExecutorBizProto.ResultReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<ExecutorBizProto.RegistryParamRequest,
      ExecutorBizProto.ResultReply> getRegistryMethod() {
    io.grpc.MethodDescriptor<ExecutorBizProto.RegistryParamRequest, ExecutorBizProto.ResultReply> getRegistryMethod;
    if ((getRegistryMethod = AdminBizGrpc.getRegistryMethod) == null) {
      synchronized (AdminBizGrpc.class) {
        if ((getRegistryMethod = AdminBizGrpc.getRegistryMethod) == null) {
          AdminBizGrpc.getRegistryMethod = getRegistryMethod =
              io.grpc.MethodDescriptor.<ExecutorBizProto.RegistryParamRequest, ExecutorBizProto.ResultReply>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "registry"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ExecutorBizProto.RegistryParamRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ExecutorBizProto.ResultReply.getDefaultInstance()))
              .setSchemaDescriptor(new AdminBizMethodDescriptorSupplier("registry"))
              .build();
        }
      }
    }
    return getRegistryMethod;
  }

  private static volatile io.grpc.MethodDescriptor<ExecutorBizProto.RegistryParamRequest,
      ExecutorBizProto.ResultReply> getRegistryRemoveMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "registryRemove",
      requestType = ExecutorBizProto.RegistryParamRequest.class,
      responseType = ExecutorBizProto.ResultReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<ExecutorBizProto.RegistryParamRequest,
      ExecutorBizProto.ResultReply> getRegistryRemoveMethod() {
    io.grpc.MethodDescriptor<ExecutorBizProto.RegistryParamRequest, ExecutorBizProto.ResultReply> getRegistryRemoveMethod;
    if ((getRegistryRemoveMethod = AdminBizGrpc.getRegistryRemoveMethod) == null) {
      synchronized (AdminBizGrpc.class) {
        if ((getRegistryRemoveMethod = AdminBizGrpc.getRegistryRemoveMethod) == null) {
          AdminBizGrpc.getRegistryRemoveMethod = getRegistryRemoveMethod =
              io.grpc.MethodDescriptor.<ExecutorBizProto.RegistryParamRequest, ExecutorBizProto.ResultReply>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "registryRemove"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ExecutorBizProto.RegistryParamRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ExecutorBizProto.ResultReply.getDefaultInstance()))
              .setSchemaDescriptor(new AdminBizMethodDescriptorSupplier("registryRemove"))
              .build();
        }
      }
    }
    return getRegistryRemoveMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static AdminBizStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<AdminBizStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<AdminBizStub>() {
        @Override
        public AdminBizStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new AdminBizStub(channel, callOptions);
        }
      };
    return AdminBizStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static AdminBizBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<AdminBizBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<AdminBizBlockingStub>() {
        @Override
        public AdminBizBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new AdminBizBlockingStub(channel, callOptions);
        }
      };
    return AdminBizBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static AdminBizFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<AdminBizFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<AdminBizFutureStub>() {
        @Override
        public AdminBizFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new AdminBizFutureStub(channel, callOptions);
        }
      };
    return AdminBizFutureStub.newStub(factory, channel);
  }

  /**
   * <pre>
   * ---------------------- callback ----------------------
   * </pre>
   */
  public static abstract class AdminBizImplBase implements io.grpc.BindableService {

    /**
     * <pre>
     **
     * callback
     * &#64;param callbackParamList
     * &#64;return
     * </pre>
     */
    public void callback(ExecutorBizProto.CallbackParamListRequest request,
                         io.grpc.stub.StreamObserver<ExecutorBizProto.ResultReply> responseObserver) {
      asyncUnimplementedUnaryCall(getCallbackMethod(), responseObserver);
    }

    /**
     * <pre>
     **
     * registry
     * &#64;param registryParam
     * &#64;return
     * </pre>
     */
    public void registry(ExecutorBizProto.RegistryParamRequest request,
                         io.grpc.stub.StreamObserver<ExecutorBizProto.ResultReply> responseObserver) {
      asyncUnimplementedUnaryCall(getRegistryMethod(), responseObserver);
    }

    /**
     * <pre>
     **
     * registry remove
     * &#64;param registryParam
     * &#64;return
     * </pre>
     */
    public void registryRemove(ExecutorBizProto.RegistryParamRequest request,
                               io.grpc.stub.StreamObserver<ExecutorBizProto.ResultReply> responseObserver) {
      asyncUnimplementedUnaryCall(getRegistryRemoveMethod(), responseObserver);
    }

    @Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getCallbackMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                ExecutorBizProto.CallbackParamListRequest,
                ExecutorBizProto.ResultReply>(
                  this, METHODID_CALLBACK)))
          .addMethod(
            getRegistryMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                ExecutorBizProto.RegistryParamRequest,
                ExecutorBizProto.ResultReply>(
                  this, METHODID_REGISTRY)))
          .addMethod(
            getRegistryRemoveMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                ExecutorBizProto.RegistryParamRequest,
                ExecutorBizProto.ResultReply>(
                  this, METHODID_REGISTRY_REMOVE)))
          .build();
    }
  }

  /**
   * <pre>
   * ---------------------- callback ----------------------
   * </pre>
   */
  public static final class AdminBizStub extends io.grpc.stub.AbstractAsyncStub<AdminBizStub> {
    private AdminBizStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected AdminBizStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new AdminBizStub(channel, callOptions);
    }

    /**
     * <pre>
     **
     * callback
     * &#64;param callbackParamList
     * &#64;return
     * </pre>
     */
    public void callback(ExecutorBizProto.CallbackParamListRequest request,
                         io.grpc.stub.StreamObserver<ExecutorBizProto.ResultReply> responseObserver) {
      ClientCalls.asyncUnaryCall(
          getChannel().newCall(getCallbackMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     **
     * registry
     * &#64;param registryParam
     * &#64;return
     * </pre>
     */
    public void registry(ExecutorBizProto.RegistryParamRequest request,
                         io.grpc.stub.StreamObserver<ExecutorBizProto.ResultReply> responseObserver) {
      ClientCalls.asyncUnaryCall(
          getChannel().newCall(getRegistryMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     **
     * registry remove
     * &#64;param registryParam
     * &#64;return
     * </pre>
     */
    public void registryRemove(ExecutorBizProto.RegistryParamRequest request,
                               io.grpc.stub.StreamObserver<ExecutorBizProto.ResultReply> responseObserver) {
      ClientCalls.asyncUnaryCall(
          getChannel().newCall(getRegistryRemoveMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   * <pre>
   * ---------------------- callback ----------------------
   * </pre>
   */
  public static final class AdminBizBlockingStub extends io.grpc.stub.AbstractBlockingStub<AdminBizBlockingStub> {
    private AdminBizBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected AdminBizBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new AdminBizBlockingStub(channel, callOptions);
    }

    /**
     * <pre>
     **
     * callback
     * &#64;param callbackParamList
     * &#64;return
     * </pre>
     */
    public ExecutorBizProto.ResultReply callback(ExecutorBizProto.CallbackParamListRequest request) {
      return blockingUnaryCall(
          getChannel(), getCallbackMethod(), getCallOptions(), request);
    }

    /**
     * <pre>
     **
     * registry
     * &#64;param registryParam
     * &#64;return
     * </pre>
     */
    public ExecutorBizProto.ResultReply registry(ExecutorBizProto.RegistryParamRequest request) {
      return blockingUnaryCall(
          getChannel(), getRegistryMethod(), getCallOptions(), request);
    }

    /**
     * <pre>
     **
     * registry remove
     * &#64;param registryParam
     * &#64;return
     * </pre>
     */
    public ExecutorBizProto.ResultReply registryRemove(ExecutorBizProto.RegistryParamRequest request) {
      return blockingUnaryCall(
          getChannel(), getRegistryRemoveMethod(), getCallOptions(), request);
    }
  }

  /**
   * <pre>
   * ---------------------- callback ----------------------
   * </pre>
   */
  public static final class AdminBizFutureStub extends io.grpc.stub.AbstractFutureStub<AdminBizFutureStub> {
    private AdminBizFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected AdminBizFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new AdminBizFutureStub(channel, callOptions);
    }

    /**
     * <pre>
     **
     * callback
     * &#64;param callbackParamList
     * &#64;return
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<ExecutorBizProto.ResultReply> callback(
        ExecutorBizProto.CallbackParamListRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getCallbackMethod(), getCallOptions()), request);
    }

    /**
     * <pre>
     **
     * registry
     * &#64;param registryParam
     * &#64;return
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<ExecutorBizProto.ResultReply> registry(
        ExecutorBizProto.RegistryParamRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getRegistryMethod(), getCallOptions()), request);
    }

    /**
     * <pre>
     **
     * registry remove
     * &#64;param registryParam
     * &#64;return
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<ExecutorBizProto.ResultReply> registryRemove(
        ExecutorBizProto.RegistryParamRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getRegistryRemoveMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_CALLBACK = 0;
  private static final int METHODID_REGISTRY = 1;
  private static final int METHODID_REGISTRY_REMOVE = 2;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final AdminBizImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(AdminBizImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @Override
    @SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_CALLBACK:
          serviceImpl.callback((ExecutorBizProto.CallbackParamListRequest) request,
              (io.grpc.stub.StreamObserver<ExecutorBizProto.ResultReply>) responseObserver);
          break;
        case METHODID_REGISTRY:
          serviceImpl.registry((ExecutorBizProto.RegistryParamRequest) request,
              (io.grpc.stub.StreamObserver<ExecutorBizProto.ResultReply>) responseObserver);
          break;
        case METHODID_REGISTRY_REMOVE:
          serviceImpl.registryRemove((ExecutorBizProto.RegistryParamRequest) request,
              (io.grpc.stub.StreamObserver<ExecutorBizProto.ResultReply>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @Override
    @SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class AdminBizBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    AdminBizBaseDescriptorSupplier() {}

    @Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return ExecutorBizProto.getDescriptor();
    }

    @Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("AdminBiz");
    }
  }

  private static final class AdminBizFileDescriptorSupplier
      extends AdminBizBaseDescriptorSupplier {
    AdminBizFileDescriptorSupplier() {}
  }

  private static final class AdminBizMethodDescriptorSupplier
      extends AdminBizBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    AdminBizMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (AdminBizGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new AdminBizFileDescriptorSupplier())
              .addMethod(getCallbackMethod())
              .addMethod(getRegistryMethod())
              .addMethod(getRegistryRemoveMethod())
              .build();
        }
      }
    }
    return result;
  }
}
